package testgradle;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;

/**
 * @author miweidong
 * @date 2021-06-30 19:00
 */
public class GradleTest {

    public String getMessage() {
        return "Hello miweidong";
    }

    public static void main(String[] args) throws ExecutionException, InterruptedException {
        System.out.println("小明进入餐厅");
        System.out.println("小明点了份番茄炒鸡蛋");
        CompletableFuture<String> future = CompletableFuture.supplyAsync(() -> {
            System.out.println("厨师去炒饭");
            return "番茄炒鸡蛋";
        });
        System.out.println("小明在打王者");
        System.out.println("饭好了,开始干饭--" + future.join());
        System.out.println("小明用餐 ");

    }
}
